package com.atwisdom.star.serviceController.quality;

import com.alibaba.fastjson.JSONObject;
import com.atwisdom.star.common.vo.ResultInfo;
import com.atwisdom.star.exception.pojo.BusinessException;
import com.atwisdom.star.log.aop.StarAnnotation;
import com.atwisdom.star.service.quality.impl.QualityInspectionServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: InspectionServiceController
 * @ Description:
 * @author:王红艳
 * @date:
 */
@RestController
@RequestMapping("/quality")
public class QualityInspectionServiceController {
    @Autowired
    private QualityInspectionServiceImpl qualityInspectionService;

    /**
     * 根据物料查询物料容器存在则查询返回，不存在则新增返回
     * @param data 物料数据
     * @throws BusinessException
     */
    @StarAnnotation
    @PostMapping("/queryMaterialTemById")
    public ResultInfo<?> queryMaterialTemById(@RequestBody JSONObject data)  throws BusinessException {
        return qualityInspectionService.queryMaterialTemById(data);
    }

}
